<template>
  <div>
    <el-card class="box-card">
    <el-form
      :inline="true"
      :model="dataForm"
      @keyup.enter.native="getExportDispatchList()"
      class="dadeFrom"
    >
    <el-select v-model="dataForm.status" placeholder="知识状态" clearable style="width: 200px">
      <el-option
        v-for="option in latnIdList"
        :key="option.latnId"
        :label="option.latnName"
        :value="option.latnId"
      >
      </el-option>
    </el-select>
    <el-select v-model="dataForm.name" placeholder="知识名称" clearable style="width: 200px">
      <el-option
        v-for="option in latnIdList"
        :key="option.latnId"
        :label="option.latnName"
        :value="option.latnId"
      >
      </el-option>
    </el-select>
    <el-select v-model="dataForm.linkUrl" placeholder="链接地址" clearable style="width: 200px">
      <el-option
        v-for="option in latnIdList"
        :key="option.latnId"
        :label="option.latnName"
        :value="option.latnId"
      >
      </el-option>
    </el-select>
    <el-date-picker
      v-model="dataForm.timeVal"
      type="datetime"
      placeholder="选择日期时间">
    </el-date-picker>
    <el-button @click="searchData()" type="primary">查询</el-button>
    </el-form>
    </el-card>
    <el-card class="box-card" style="margin-top: 10px;">
      <el-button type="success" size="mini">新增</el-button>
      <el-button type="danger" size="mini">批量删除</el-button>
      <el-table
        :data="dataList"
        style="width: 100%;margin-top: 20px;"
        @selection-change="handleSelectionChange"
        v-loading="loading"
        element-loading-text="拼命加载中"
        element-loading-spinner="el-icon-loading"
        element-loading-background="rgba(12,42,98, 0.9)"
      >
      <el-table-column
        type="selection"
        width="55">
      </el-table-column>
      <el-table-column
          type="index"
          label="序号"
          align="center"
        >
        </el-table-column>
        <el-table-column
          prop="dayId"
          label="知识名称"
          align="center"
        >
        </el-table-column>
        <el-table-column
          label="状态"
          align="center"
        >
        </el-table-column>
        <el-table-column
          label="知识链接地址"
          align="center"
        >
        </el-table-column>
        <el-table-column
          label="知识日期"
          align="center"
        >
        </el-table-column>
        <el-table-column
          label="操作"
          align="center"
        >
        <template slot-scope="scope">
          <el-button type="primary" size="small" @click="handleEdit(scope.row)">编辑</el-button>
          <el-button size="small" type="danger" @click="handleDelete(scope.row)">删除</el-button>
        </template>
        </el-table-column>
      </el-table>
      <!-- 分页 -->
      <Pagination
        :total="total"
        :pageNum="pageNum" 
        :pageSize="pageSize" 
        @pageChange="pageChange"
      />
    </el-card>
    <!-- 弹窗, 新增 / 修改 -->
  </div>
</template>

<script>
import axios from "axios";
export default {
  data() {
    return {
      loading:false,
        dataList: [],
        pageNum: 1,
        pageSize: 10,
        total: 0,
        latnIdList: [],
        dataForm: {
          status: '',
          name: '',
          linkUrl: '',
          timeVal: ''
        },

      }
  },
  created() {
  },
  activated: function () {
  },
  methods: {
    // 多选
    handleSelectionChange (val) {
      console.log(val)
    },
    // 点击搜索
    searchData () {},
    // 获取表格数据
    fetchTableList () {},
   //编辑 
    handleEdit () {},
    // 删除
    handleDelete () {},
    // 再次提醒
    // 分页
    pageChange (page) {
      this.pageSize = page._pageSize;
      this.pageNum = page._currentPage;
      this.fetchTableList()
    }
  }
};
</script>
<style scoped>
</style>
